<template>
  <div>
    <div class="fujianList f-bian" v-for="(item,index) in attachmentList" :key="index"  v-if="attachmentList.length>0">
      <div class="attachmentL flex itemCenter" >
        <img src="../../assets/commonImg/word.png" alt=""> <div class="attachmentTitle flex1 overflow3">名称：{{item.FileName}}</div>
        <div class="type" >类型：{{item.FileType}}</div>
        <!--<div class="type" v-if="isResult">大小：{{item.size}}</div>-->
      </div>
      <div class="attachmentR " ><span><button @click="do_handle('show',item.dUrl)">预览</button> <button @click="do_handle('down',item.SN)">下载</button></span><span v-show="isResult" @click="do_handle(item.dUrl)"><span class="iconfont icon-shanchu"></span>删除</span> </div>
      <!--<div class="attachmentR " v-if="isResult"> </div>-->
    </div>
    <div v-if="attachmentList.length===0" class="noData f-zhong">暂无附件！</div>
  </div>

</template>

<script>
    export default {
        name: "detail-attach",
      props:{
        attachmentList:Array,
        isResult:{
          type:Boolean,
          default:false
        }
      },
      methods:{
        do_handle(item1,item){
          // this.$emit('do_handle',item)
          if(item1.indexOf("show")>=0){
            window.open(item)
          }else {
            let me = this
            me.$ZcPublic.zcServer.DownOss({
              Scope: me,
              FileSN: item
            });
          }
        }
      }
    }
</script>

<style scoped>
  /*附件列表*/
  .fujianList{
    height: 50px;
    line-height: 50px;
    padding: 10px 20px;
  }
  .fujianList .attachmentR button{
    background-color: transparent;
    border: none;
    padding: 2px 4px;
    color: #478FFC;
    margin-left: 10px;
    position: relative;
    height:25px ;
    line-height: 23px;
    cursor: pointer;
    font-size: 14px !important;
  }
  .attachmentR span{
    cursor: pointer;
  }
  .fujianList .attachmentR button:first-child:after{
    content: '';
    position: absolute;
    height: 18px;
    width: 1px;
    background-color: #478FFC;
    right: -6px;
    top: 5px;
  }
  .attachmentL img{
    width: 25px;
    height: 30px;
    margin-right: 20px;
  }
  .type{
    width: 120px;
    margin-left: 20px;
  }
  .attachmentTitle {
    max-width: 545px;
    min-width: 260px;
  }
  .icon-shanchu{
    /*color: black;*/
    color: #FC6268;
    margin-right: 5px;
    margin-left: 30px;
  }
  .noData{
    color: grey;
    height: 100px;
  }
</style>
